package section10;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class App10_7 {
    public static void main(String[] args){
        String thisLine;
        int count=0;
        try(FileReader fr=new FileReader("C:\\Users\\Administrator\\Desktop\\10_7.txt");
            BufferedReader bfr=new BufferedReader(fr);){
            while ((thisLine= bfr.readLine())!=null){
                count++;
                System.out.println("第"+count+"行： "+thisLine);
            }
            System.out.println("共读取了"+count+"行！");
        }
        catch (IOException ioe){}
    }
}
